﻿package com.devilcat.ob {
	
	import flash.display.MovieClip;
	import fl.transitions.Tween;
	import fl.transitions.easing.*;
	import fl.transitions.TweenEvent; 
	import com.devilcat.dt.Itemdt;
	import com.devilcat.dt.Gamedt;
	
	
	public class NPCSell extends MovieClip {
		public var tweenList:Array = new Array();
		
		//public function NPCSell(XMLData:XMLList) {
		public function NPCSell(xmm:XMLList) {
			var itemLeng:Number=xmm.it.length();
			for(var i:int=0;i<itemLeng;i++){
				var newItdt:Itemdt= new Itemdt();
				newItdt.getBase(xmm.it[i].Code);
				newItdt.uid=Gamedt.Player.uid;
				newItdt.NumberOf=1;
				var newIt:Itemob = new Itemob(newItdt);
				newIt.y=0-i*24;
				newIt.buyText();
				newIt.AddEventBuyItem();
				ItemPanel.addChild(newIt);
//				var newButton:Itemdt =SQLData.GetItemFromXML(xmm.it[i]);
//				newButton.y=0-i*24;
//				newButton.AddEventBuyItem();
//				ItemPanel.addChild(newButton);
			}
			x=200;
		}
		public function addMe(){
			tweenList.unshift(new Tween (this,"alpha",Strong.easeOut,0,1,2,true));
			tweenList.unshift(new Tween (this,"y",Strong.easeOut,this.y-50,this.y,2,true));
		}
	}
}
